<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>

        var date = new Date()

        var year = date.getFullYear()
        var month = date.getMonth()
        // console.log(month)
        var day = date.getDate()


        var day1 = date.getDay()

        console.log(day1)

        // 
        console.log(new Date(2019, 2, 0).getDay())

    </script>
</body>

</html>